package dao;

import java.io.Serializable;
import java.util.List;

import modelo.Tipoevento;

import org.hibernate.Criteria;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;

import util.HibernateUtil;

public class TipoEventoDao implements Serializable{

	private static final long serialVersionUID = 5301549197518907421L;

	private Session session;
	SessionFactory sessionFactory = HibernateUtil.getSessionFactory();
	
	public TipoEventoDao() {
		super();
	}
	
	public List<Tipoevento> obtenerTipoEvento() {
		session=sessionFactory.openSession();
		
		Criteria cr = session.createCriteria(Tipoevento.class);
		List results = cr.list();
		session.close();
		
		return results;
	}

	public List<Tipoevento> obtenerTipoEvento(Integer salonSel) {
		session=sessionFactory.openSession();
		
		Criteria cr = session.createCriteria(Tipoevento.class);
//				.add(Restrictions.eq("estadopresupuesto.idEstadoPresupuesto", 1));
		List results = cr.list();
		session.close();
		
		return results;
	}
}
